]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Fix infinite loop when finding parent window of dialogs
authorverdre <gitlab@v0yd.nl>
Mon, 23 Jul 2018 12:22:34 +0000 (14:22 +0200)
committerverdre <gitlab@v0yd.nl>
Thu, 2 Aug 2018 22:09:02 +0000 (00:09 +0200)
When a dialog is added to a window while the overview is shown, we get
its parent using get_transient_for() so we can add it to the right
window clone.

If we have multiple layers of dialogs we have to do this recursively
until we find the root ancestor. This case currently results in an
infinite loop: Since parent is always set to the same window, the
while-condition will always be true.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/180

js/ui/workspace.js
js/ui/workspaceThumbnail.js

index a183e0749a9d166789e3ad828328ce6a24c39365..6a8e924475133c945826ae53d07a0c56c0ea26ea 100644 (file)
@@ -1519,7 +1519,7 @@ var Workspace = new Lang.Class({
             if (metaWin.is_attached_dialog()) {
                 let parent = metaWin.get_transient_for();
                 while (parent.is_attached_dialog())
-                    parent = metaWin.get_transient_for();
+                    parent = parent.get_transient_for();
 
                 let idx = this._lookupIndex (parent);
                 if (idx < 0) {
index b1fa587fe8743696ba9db7575973667b4e221417..cf21e13170adf93752150428e6e44bc710bef53b 100644 (file)
@@ -416,7 +416,7 @@ var WorkspaceThumbnail = new Lang.Class({
         } else if (metaWin.is_attached_dialog()) {
             let parent = metaWin.get_transient_for();
             while (parent.is_attached_dialog())
-                parent = metaWin.get_transient_for();
+                parent = parent.get_transient_for();
 
             let idx = this._lookupIndex (parent);
             if (idx < 0) {